"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
// 定义类
var Person = /** @class */ (function () {
    function Person() {}
    Person.prototype.getName = function () {
        console.log(this.name);
    };
    return Person;
}());
var p1 = new Person();
p1.name = 'zhufeng';
p1.getName();
// 定义存取器:目的 改变类中读取和赋值的操作
var User = /** @class */ (function () {
    function User(myName) {
        this.myName = myName;
    }
    Object.defineProperty(User.prototype, "name", {
        // 读取操作
        get: function () {
            console.log(this.myName, '读取值');
            return this.myName;
        },
        // 存取操作
        set: function (value) {
            this.myName = value;
            console.log(this.myName, 'myName');
        },
        enumerable: false,
        configurable: true
    });
    return User;
}());
var user = new User('zhufeng');
user.name = 'jiagou';
console.log(user.name);